<template>
    <div>
<!--        管理文章-->
        <dao-hang></dao-hang>
        <div style="display: flex;">
            <div style="flex: 1%;"></div>
            <!--                中央布局内-->
            <div class="imageOne" style="background-color: white;width: 1730px;height: 1000px; margin-top:100px;margin-right:10px;flex:12;border-radius: 4px;display: flex;margin-bottom: 150px;">
                <div style="flex: 1"></div>
                <div style="flex: 4;margin-top: 70px;" class="sidebar">
                    <el-container>
                        <el-header>
<!--                            <el-button style="float: right"  @click="$router.push('/article')">管理文章</el-button>-->
                            <h2>
                                欢迎用户：{{userInfo.name}}</h2>
                        </el-header>
                        <el-container>
                            <el-aside width="200px">    <!--  左边导航栏组件-->
                                <div class="sidebar" >

<!--                                class="sidebar-el-menu"           :default-active="onRoutes"-->
                                    <el-menu


                                            background-color="#334256"
                                            text-color="#ffffff"
                                            active-text-color="#20a0ff"
                                            router
                                    >
                                        <template v-for="item in items">
                                            <template>
                                                <el-menu-item :index="item.index" :key="item.index">
                                                    <i :class="item.icon"></i>
                                                    {{item.title}}
                                                </el-menu-item>
                                            </template>
                                        </template>

                                    </el-menu>
                                </div>
                            </el-aside>
                            <el-main style="padding: 0px;margin-left: 30px;">
                                <router-view></router-view>
                            </el-main>
                        </el-container>
                    </el-container>
                </div>
                <div style="flex: 1"></div>
            </div>
            <div style="flex: 1%"></div>
        </div>
    </div>

</template>

<script>
    // import bus from '../router/bus'


    export default {
        name: "onlyone",
        data() {
            return {
                token: localStorage.getItem('TOKEN'),
                userInfo:{},

                tabPosition: 'left',
                items: [
                    {

                        icon: 'el-icon-user',
                        index: 'info',
                        title: '基本信息',
                    },
                    {

                        icon: 'el-icon-s-custom',
                        index: 'profi',
                        title: '上传头像',
                    },
                    {

                        icon: 'el-icon-menu',
                        index: 'blogs',
                        title: '我的博客',
                    },
                    {

                        icon: 'el-icon-edit',
                        index: 'dat',
                        title: '修改资料',
                    },
                    {

                        icon: 'el-icon-view',
                        index: 'pasw',
                        title: '修改密码',
                    },

                ],
                info: [
                    {
                        ima: ''
                    }
                ]

                ,

            }
        },
        created() {
            this.$axios.get("/api/user/main/info",{headers:{TOKEN:this.token}}).then(res=>{
                this.userInfo = res.data.data;
            })

        }
    }
</script>

<style scoped>
    .imageOne{
        background-image: url("https://img0.baidu.com/it/u=3037405120,4038196290&fm=26&fmt=auto&gp=0.jpg");
        background-size: 100%;
    }
</style>